package com.hyjx.framework.component.upload;

import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * 附件上传服务类接口类
 *
 * @author dijian
 */
public interface UploadService {
    
    /**
     * 查询信息列表
     *
     * @return
     */
    public String queryList(Object model);
    
    /**
     * 添加信息
     */
    public boolean add(MultipartHttpServletRequest request, HttpServletResponse response);
    
    /**
     * 根据ID查询信息
     */
    public Object getInfoById(String s);
    
    /**
     * 删除信息
     *
     * @param ids
     */
    public int delete(String ids);
    
    /**
     * 下载文件
     *
     * @param request
     * @param response
     * @return
     */
    public String download(HttpServletRequest request, HttpServletResponse response);
    
    /**
     * 预览文件
     *
     * @param request
     * @param response
     * @return
     */
    public String view(HttpServletRequest request, HttpServletResponse response);
    
    
    /**
     * 取加特林地
     *
     * @param cateogry
     * @param request
     * @param response
     */
    public void getIcon(String cateogry, HttpServletRequest request,
                        HttpServletResponse response);
    
    /**
     * 查询当前图片
     *
     * @param request
     * @return
     */
    public String queryCurrentPics(HttpServletRequest request);
    
    /**
     * 根据存储名取上传附件信息
     *
     * @param storageName
     * @return
     */
    public Object getUploadModelByStorageName(String storageName);
    
    /**
     * 增加捕获
     *
     * @param request
     * @param response
     * @throws Exception
     */
    public void addCapture(HttpServletRequest request, HttpServletResponse response) throws Exception;
}
